<?php

class UserLogin extends Portlet {

    protected function renderContent() {
        if(Yii::app()->user->isGuest) {
            $FormLogin = new FormLogin();
            $form = new CForm($FormLogin->config, $FormLogin);
            if($form->submitted('login') && $form->validate()) Yii::app()->controller->redirect("/");
            $this->render('userLogin', array('form' => $form));
        }
    }
}
